<template>
    <div>
        <el-header style="text-align: right; font-size: 15px">
            <span>
                欢迎使用学籍管理系统-查看学历
            </span>
        </el-header>
        <el-table
                :data="tableData"
                border
                style="width: 100%">
            <el-table-column
                    fixed
                    prop="s_id"
                    label="学号"
                    width="130%">
            </el-table-column>
            <el-table-column
                    fixed
                    prop="s_name"
                    label="姓名"
                    width="130%">
            </el-table-column>

            <el-table-column
                    fixed
                    prop="r_junior"
                    label="初中"
                    width="250%">
            </el-table-column> <el-table-column
                    fixed
                    prop="r_high"
                    label="高中"
                    width="250%">
            </el-table-column> <el-table-column
                    fixed
                    prop="r_university"
                    label="大学"
                    width="250%">
            </el-table-column>
            <el-table-column
                    fixed
                    label="操作"
                    width="102">
                <template slot-scope="scope">
                    <el-button @click="modify(scope.row)" type="text" size="small">修改/新增</el-button>
                </template>
            </el-table-column>
        </el-table>
        <el-form>
            <el-form-item>
                <el-button  type="primary" @click="backForm()">返 回</el-button>
            </el-form-item>
        </el-form>

    </div>
</template>

<script>
    export default {
        methods: {
            modify(row){
                this.$router.push({
                    path: '/Page11',
                    query:{
                        id:row.s_id
                    }
                })
            },
            backForm() {
                this.$router.push('/Page1')
            }


        },
        created() {
            const _this = this
            axios.get('http://localhost:8181/student2/getOne/'+this.$route.query.id).then(function (resp) {
                _this.tableData = resp.data
            })
        },
        data() {
            return {
                total: null,
                tableData: null
            }
        }
    }
</script>